export const teacherManageConfig = {
  type: "page",
  title: "Hello world",
  body: [
    {
      type: "crud",
      syncLocation: false,
      api: {
        method: "get",
        url: "http://localhost:8080/teacher/teacherlist",
        messages: {},
        requestAdaptor: "",
        adaptor: "",
        dataType: "json",
      },
      columns: [
        {
          name: "teacherId",
          label: "ID",
          type: "text",
          id: "u:c1a7ff570c20",
        },
        {
          type: "text",
          label: "姓名",
          name: "name",
          id: "u:c0d2b2fb7767",
        },
        {
          type: "text",
          name: "phone",
          label: "电话号码",
          id: "u:bbc2958919e6",
        },
        {
          type: "text",
          name: "className",
          label: "班级",
          id: "u:8e1985be70ca",
          placeholder: "-",
        },
        {
          type: "operation",
          label: "操作",
          buttons: [
            {
              label: "编辑",
              type: "button",
              actionType: "dialog",
              level: "link",
              dialog: {
                title: "修改",
                body: [
                  {
                    type: "form",
                    api: {
                      method: "put",
                      url: "http://localhost:8080/teacher",
                      requestAdaptor: "",
                      adaptor: "",
                      messages: {},
                      dataType: "json",
                    },
                    body: [
                      {
                        name: "teacherId",
                        label: "ID",
                        type: "input-text",
                        id: "u:8b77d0451a2b",
                        static: true,
                      },
                      {
                        label: "姓名",
                        name: "name",
                        type: "input-text",
                        id: "u:27f1b52ba02b",
                      },
                      {
                        name: "phone",
                        label: "电话号码",
                        type: "input-text",
                        id: "u:958a5464c6fe",
                      },
                      {
                        name: "classId",
                        label: "班级",
                        type: "select",
                        id: "u:8f2b73eded2c",
                        multiple: false,
                        source: {
                          url: "http://localhost:8080/class/list",
                          method: "get",
                          requestAdaptor: "",
                          adaptor: "return payload.data.clazzList;",
                          messages: {},
                        },
                        labelField: "name",
                        valueField: "id",
                      },
                    ],
                    id: "u:dcf05ca1418f",
                    submitText: "提交",
                  },
                ],
                type: "dialog",
                id: "u:838fd9c7fc18",
                showCloseButton: true,
                closeOnEsc: false,
                showErrorMsg: true,
                showLoading: true,
              },
              id: "u:be03edd7113c",
            },
            {
              type: "button",
              label: "删除",
              actionType: "ajax",
              level: "link",
              className: "text-danger",
              confirmText: "确定要删除？",
              api: {
                method: "delete",
                url: "http://localhost:8080/teacher/$teacherId",
              },
              id: "u:aa66b93f9ba5",
            },
          ],
          id: "u:87c36726ab7d",
        },
      ],
      bulkActions: [],
      itemActions: [],
      features: ["create", "update", "delete"],
      headerToolbar: [
        {
          label: "新增",
          type: "button",
          actionType: "dialog",
          level: "primary",
          dialog: {
            title: "新增",
            body: [
              {
                type: "form",
                api: {
                  method: "post",
                  url: "http://localhost:8080/teacher",
                  requestAdaptor: "",
                  adaptor: "",
                  messages: {},
                  dataType: "json",
                },
                body: [
                  {
                    type: "input-text",
                    label: "账户",
                    name: "account",
                    id: "u:3a2727a5d443",
                    required: true,
                  },
                  {
                    type: "input-text",
                    name: "name",
                    label: "名字",
                    id: "u:a7decf710ce1",
                    required: true,
                  },
                  {
                    type: "input-text",
                    name: "phone",
                    label: "电话号码",
                    id: "u:77b371292b32",
                    required: true,
                  },
                  {
                    type: "select",
                    name: "class_id",
                    label: "所在班级",
                    id: "u:183dc6f89740",
                    multiple: false,
                    value: "",
                    source: {
                      url: "http://localhost:8080/class/list",
                      method: "get",
                      requestAdaptor: "",
                      adaptor:
                        "const data = payload.data.clazzList;\r\nreturn data;",
                      messages: {},
                    },
                    labelField: "name",
                    valueField: "id",
                    required: true,
                  },
                  {
                    type: "input-password",
                    label: "登录密码",
                    name: "password",
                    id: "u:c4a8b5531b97",
                    showCounter: false,
                    clearable: true,
                    required: true,
                  },
                ],
                id: "u:23042eb00ea5",
              },
            ],
            type: "dialog",
            id: "u:0fef28a9a015",
          },
          id: "u:846eca6da78b",
        },
        "bulkActions",
      ],
      id: "u:72ee6104cd95",
      perPageAvailable: [10],
      messages: {},
      filter: {
        title: "查询条件",
        body: [
          {
            type: "input-text",
            name: "name",
            label: "教师姓名",
            id: "u:9d36849ee425",
            clearable: true,
          },
        ],
        id: "u:275ff01b98d5",
      },
      footerToolbar: [
        {
          type: "statistics",
        },
        {
          type: "pagination",
          align: "right",
        },
      ],
      alwaysShowPagination: true,
    },
  ],
  id: "u:8d661f13be56",
  asideResizor: false,
  pullRefresh: {
    disabled: true,
  },
  regions: ["body"],
};
